package de.johanngehrisch.pacecalc.android.activities;

import de.johanngehrisch.pacecalc.android.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class AppInfoActivity extends Activity {
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.appinfo);

		Button emailButton = (Button) findViewById(R.id.button_contactme);

		emailButton.setOnClickListener(new OnClickListener() {

			public void onClick(View v) {

				Intent emailIntent = new Intent(
						android.content.Intent.ACTION_SEND);

				String[] recipients = new String[] { getString(R.string.contactme_recipient) };

				emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,
						recipients);
				emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,
						getString(R.string.contactme_subject));
				emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "");
				emailIntent.setType("text/plain");

				startActivity(Intent.createChooser(emailIntent,
						getString(R.string.contactme_submit)));
				finish();

			}

		});
	}
}
